package com.wcarmon.life.business {

    import com.adobe.cairngorm.business.ServiceLocator;
    import com.adobe.cairngorm.business.IServiceLocator;
    import com.adobe.cairngorm.commands.ICommand
    import com.adobe.cairngorm.control.CairngormEvent;
	
    import com.wcarmon.life.vo.*;
	import mx.rpc.AsyncToken;
	import mx.rpc.events.FaultEvent;
	import mx.rpc.events.ResultEvent;
	import mx.rpc.IResponder;
	import flash.utils.*;
	import mx.logging.*;
	
	
	public class UpdateStatsDelegate {
		include "../../includes/loggerSnippet.as";
		
		private var responder : IResponder;
		private var service : Object;
		
		public function UpdateStatsDelegate( responder : IResponder ){
			this.service = ServiceLocator.getInstance().getRemoteObject("LifeDashboardService");
			this.responder = responder;
			log.info( 'Using this php file: ' + this.service.source );
		}
		public function update() : void {
			log.debug( "getting statistics" );
			var call : Object = service.getStats();
			call.addResponder( responder );
		}
	}
}